//
//  LatLngModel.m
//  o_amap
//
//  Created by Q神 on 2021/4/12.
//

#import "LatLngModel.h"

@implementation LatLngModel

+ (LatLngModel *)initWithLat:(double)lat withLng:(double)lng {
    LatLngModel *model = [[LatLngModel alloc] init];
    if (lat) {
        model.latitude = [NSNumber numberWithDouble:lat];
    }
    
    if (lng) {
        model.longitude = [NSNumber numberWithDouble:lng];
    }
    return model;
}

- (void)changeLatLngWithMapView:(MAMapView *)mapView {
    CLLocationCoordinate2D center = CLLocationCoordinate2DMake([self.latitude floatValue], [self.longitude floatValue]);
    [mapView setCenterCoordinate:center animated:YES];
}

@end
